package com.example.webdome.controller;

import com.example.webdome.pojo.Result;
import com.example.webdome.service.ValidationService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/emails")
public class EmailController {
    @Resource
    private ValidationService validationService;
    //注册邮箱验证码发送
    @PostMapping("/send/registerCode")
    public Result sentRegisterEmail(@RequestParam String email){
       return validationService.sendRegisterEmail(email);
    }
    //找回密码邮箱验证码发送
    @PostMapping("/send/findCode")
    public Result sendFindEmail(String email) {
        return validationService.sendFindEmail(email);
    }

}
